//
//  DataEngine.h
//  Nurse
//
//  Created by 夏 申频 on 14-1-5.
//  Copyright (c) 2014年 Honeywell. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ProcedureCallRequest.h"

@interface DataEngine : NSObject

+(DataEngine*) sharedInstance;
+(NSError*)makeErrorForMsg:(NSString*)errMsg;
-(DataEngine*) initWithHostName:(NSString*) hostname;
-(NSURL*) urlForPath:(NSString*)path;

-(void)showMessage:(NSString*)message withTitle:(NSString*)title;
//-(void)showMessageyesno:(NSString*)message withTitle:(NSString*)title otherTitle:(NSString *)otherTitle
//             completion:(void(^) (BOOL cancelled))completion;

-(void)postRequest:(NSData*)request forPath:(NSURL*)url withHandler:(RawHandler)handler;
-(void)postJsonRequest:(id)obj forPath:(NSURL*)url withSuccessHandler:(SuccessHandler)successHandler andFailHandler:(FailHandler)failHandle;
-(void)callProcedure:(ProcedureCallRequest*)procedureRequest forURL:(NSURL*)url;

@end
